<%@ Page Title="" MasterPageFile="~/BackOffice.master" Language="C#" AutoEventWireup="true" CodeBehind="CadastroEstatico.aspx.cs" Inherits="MakeIT.Look.Imagem.Apresentacao.CadastroEstatico" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="cHeadHttpEquiv" ContentPlaceHolderID="headHttpEquiv" runat="server">
     <meta http-equiv="X-UA-Compatible" content="IE=8" />
</asp:Content>
<asp:Content ID="cHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="cCadastro" ContentPlaceHolderID="cphTituloCadastro" runat="server">
    Cadastro de Conte&uacute;do&nbsp;Est&aacute;tico (estatico)
</asp:Content>

<asp:Content ID="cMain" ContentPlaceHolderID="cphMain" runat="server">

    <asp:UpdatePanel ID="upnEstatico" runat="server">
        <ContentTemplate>
            <asp:TabContainer ID="tabEstatico" runat="server" ActiveTabIndex="0">
                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 100%; background-color:#eeeeff; min-width:400px; min-height:300px;">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="middle" style="width:24px;">
                                        <asp:ImageButton ID="ibPesquisa" runat="server" OnClick="btnPesquisa_Click" 
                                                  ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/search.png" 
                                                  ToolTip="Executa a pesquisa aplicando os filtros"/>
                                    </td>
                                    <td valign="middle" align="left">
                                        Filtros:
                                    </td>
                                    <td>
                                        <div class="FormDiv">
                                            <div class="FormLabel">C&oacute;digo:</div>
                                            <asp:TextBox ID="txtIdEstatico" MaxLength="11" Width="76" onkeypress="strictNum();" onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="meetxtIdEstatico" runat="server" Mask="99999999999" TargetControlID="txtIdEstatico" PromptCharacter="" />
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">Nome:</div>
                                            <asp:TextBox ID="txtNome" MaxLength="50" Width="100" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <hr />
                            <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!"
                                  CellPadding="1" ForeColor="#333333" GridLines="Both"  RowStyle-ForeColor="#333333" RowStyle-BackColor="#F7F6F3"
                                  AllowPaging="true" PageSize="50" OnPageIndexChanging="grvResultado_PageIndexChanging" >
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                ImageUrl="~/App_Themes/Padrao/imagens/backoffice/editar.gif" CommandArgument='<%#Eval("PKString") %>'
                                                ToolTip="Abrir formul&aacute;rio completo" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="idEstatico" HeaderText="C&oacute;digo" DataFormatString="{0:N0}"/>
                                    <asp:BoundField DataField="nome" HeaderText="Nome"/>
                                </Columns>
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#999999" />
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            </asp:GridView>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabCadastro" runat="server" HeaderText="Cadastro">
                    <ContentTemplate>
                        <asp:Panel ID="panelCad" runat="server" BackColor="#eeeeee">
                            <div style="width: 100%; min-width:400px; min-height:300px;">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <asp:Panel ID="panelBotoes" runat="server">
                                                <asp:Button ID="btnSalvar" runat="server" Enabled="False" ValidationGroup="Salvar"
                                                    OnClick="btnSalvar_Click" Text="Salvar" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" 
                                                    Text="Cancelar" UseSubmitBehavior="false"/>
                                                <asp:Button ID="btnEditar" runat="server" Enabled="False" 
                                                    OnClick="btnEditar_Click" Text="Editar" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnExcluir" runat="server" Enabled="False" 
                                                    OnClick="btnExcluir_Click" Text="Excluir" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnNovo" runat="server" 
                                                    OnClick="btnNovo_Click" Text="Novo" UseSubmitBehavior="false"/>
                                                <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="btnExcluir" ConfirmText="Confirma a exclus&atilde;o de Conte&uacute;do&nbsp;Est&aacute;tico?">
                                                </asp:ConfirmButtonExtender>
                                                <hr />
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">C&oacute;digo:</div>
                                                <asp:TextBox ID="txtCadIdEstatico" MaxLength="11" Width="76" onkeypress="strictNum();" onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:MaskedEditExtender ID="meetxtCadIdEstatico" runat="server" Mask="99999999999" TargetControlID="txtCadIdEstatico" PromptCharacter="" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Nome:</div>
                                                <asp:TextBox ID="txtCadNome" MaxLength="50" Width="310" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ControlToValidate="txtCadNome"  
                                                   ErrorMessage="Preenchimento obrigat&oacute;rio." ID="rfvtxtCadNome" Display="None"
                                                   runat="server" ValidationGroup="Salvar" ></asp:RequiredFieldValidator>
                                                <asp:ValidatorCalloutExtender ID="vcetxtCadNome" runat="server" TargetControlID="rfvtxtCadNome"></asp:ValidatorCalloutExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Conte&uacute;do&nbsp;Est&aacute;tico&nbsp;em&nbsp;Produ&ccedil;&atilde;o:</div>
                                                    <cc1:Editor ID="EditorCadConteudoPro" runat="server" ActiveMode="Preview" 
                                                        CssClass="" NoUnicode="True" Width="300px" Height="300px" BorderStyle="Groove" 
                                                        BorderWidth="1px"/>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Conte&uacute;do&nbsp;Est&aacute;tico&nbsp;em&nbsp;Edi&ccedil;&atilde;o:</div>
                                                    <cc1:Editor ID="EditorCadConteudoEdi" runat="server" ActiveMode="Preview" 
                                                        CssClass="" NoUnicode="True" Width="300px" Height="300px" BorderStyle="Groove" 
                                                        BorderWidth="1px"/>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <hr />
                                            <table  border="0" cellpadding="0" cellspacing="3">
                                                <tr>
                                                    <td class="FormLabel">
                                                        Data Cadastro:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Cadastrado por:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Data Edi&ccedil;&atilde;o:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Editado por:
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataCadastro" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltCadastradoPor" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataEdicao" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEditadoPor" runat="server"></asp:Literal>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabEstaticoFoto" runat="server" HeaderText="Foto&nbsp;Para&nbsp;Conte&uacute;do&nbsp;Est&aacute;tico">
                    <ContentTemplate>
                        <asp:Panel ID="panelEstaticoFoto" runat="server" BackColor="#eeeeee">
                            <div style="width: 100%; min-width:400px; min-height:300px;">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <div class="FormLabel">Conte&uacute;do&nbsp;Est&aacute;tico:</div>
                                            <div class="FormControl">
                                                <asp:Literal ID="ltCadEstaticoFotoEstatico" runat="server"></asp:Literal>
                                             </div>
                                             <hr />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Panel ID="panelCadEstaticoFotoBotoes" runat="server">
                                                <asp:Button ID="btnCadEstaticoFotoSalvar" runat="server" Enabled="False" ValidationGroup="EstaticoFotoSalvar"
                                                    OnClick="btnCadEstaticoFotoSalvar_Click" Text="Salvar" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnCadEstaticoFotoCancelar" runat="server" OnClick="btnCadEstaticoFotoCancelar_Click" 
                                                    Text="Cancelar" UseSubmitBehavior="false"/>
                                                <asp:Button ID="btnCadEstaticoFotoEditar" runat="server" Enabled="False" 
                                                    OnClick="btnCadEstaticoFotoEditar_Click" Text="Editar" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnCadEstaticoFotoExcluir" runat="server" Enabled="False" 
                                                    OnClick="btnCadEstaticoFotoExcluir_Click" Text="Excluir" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnCadEstaticoFotoNovo" runat="server" 
                                                    OnClick="btnCadEstaticoFotoNovo_Click" Text="Novo" UseSubmitBehavior="false"/>
                                                <asp:ConfirmButtonExtender ID="ConfirmButtonExtenderEstaticoFoto" runat="server" TargetControlID="btnCadEstaticoFotoExcluir" ConfirmText="Confirma a exclus&atilde;o de Foto&nbsp;Para&nbsp;Conte&uacute;do&nbsp;Est&aacute;tico?">
                                                </asp:ConfirmButtonExtender>
                                                <hr />
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">C&oacute;digo:</div>
                                                <asp:TextBox ID="txtCadEstaticoFotoIdEstaticoFoto" MaxLength="11" Width="76" onkeypress="strictNum();" onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:MaskedEditExtender ID="meetxtCadEstaticoFotoIdEstaticoFoto" runat="server" Mask="99999999999" TargetControlID="txtCadEstaticoFotoIdEstaticoFoto" PromptCharacter="" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Imagem:</div>
                                                <div class="FormControl">
                                                    <i><asp:Literal ID="ltCadEstaticoFotoFotoNome" runat="server"></asp:Literal> ( <asp:Literal ID="ltCadEstaticoFotoFotoMime" runat="server"></asp:Literal> )</i>
                                                </div>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <asp:AsyncFileUpload ID="afuCadEstaticoFotoFotoUpload" runat="server" UploadingBackColor="Magenta" 
                                                                OnUploadedComplete="ProcessafuCadEstaticoFotoFotoUpload" OnClientUploadComplete="showUploadConfirmation"
                                                                UploaderStyle="Traditional" Width="200" Enabled="false" />
                                                        </td>
                                                        <td>
                                                            <asp:Button ID="btCadEstaticoFotoFotoRemover" runat="server" Text="Remover" Enabled="False" OnClick="btCadEstaticoFotoFotoRemover_Click"/>&nbsp;
                                                            <asp:Button ID="btCadEstaticoFotoFotoVisualizar" runat="server" Text="Visualizar" Enabled="False" OnClick="btCadEstaticoFotoFotoVisualizar_Click"/>
                                                            <asp:ConfirmButtonExtender ID="cbeBtCadEstaticoFotoFotoRemover" runat="server" TargetControlID="btCadEstaticoFotoFotoRemover" ConfirmText="Confirma a exclus&atilde;o de Imagem?">
                                                            </asp:ConfirmButtonExtender>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <hr />
                                            <table  border="0" cellpadding="0" cellspacing="3">
                                                <tr>
                                                    <td class="FormLabel">
                                                        Data Cadastro:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Cadastrado por:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Data Edi&ccedil;&atilde;o:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Editado por:
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEstaticoFotoDataCadastro" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEstaticoFotoCadastradoPor" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEstaticoFotoDataEdicao" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEstaticoFotoEditadoPor" runat="server"></asp:Literal>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                                    <hr />
                                    <asp:GridView ID="grvCadEstaticoxEstaticoFoto" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros!"
                                          CellPadding="1" ForeColor="#333333" GridLines="Both"  RowStyle-ForeColor="#333333" RowStyle-BackColor="#F7F6F3" >
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbCadEstaticoFotoVisualizar_Click"
                                                        ImageUrl="~/App_Themes/Padrao/imagens/backoffice/editar.gif" CommandArgument='<%#Eval("PKString") %>' />
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                        <asp:BoundField DataField="idEstaticoFoto" HeaderText="C&oacute;digo" DataFormatString="{0:N0}"/>
                                            <asp:BoundField DataField="FotoNome" HeaderText="Imagem"/>
                                            <asp:BoundField DataField="FotoMime" HeaderText="Tipo"/>
                                            <asp:BoundField DataField="Cadastro" HeaderText="Cadastro" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}"/>
                                            <asp:BoundField DataField="CadastradoPor" HeaderText="Nome"/>
                                            <asp:BoundField DataField="Edicao" HeaderText="Edi&ccedil;&atilde;o" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}"/>
                                            <asp:BoundField DataField="EditadoPor" HeaderText="Nome"/>
                                        </Columns>
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <EditRowStyle BackColor="#999999" />
                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    </asp:GridView>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>

            <asp:Panel ID="PanelFoto" runat="server" Visible="false">

                <div style="position:fixed;  top:0; left:0; background-color:Gray; filter: alpha(opacity=50); opacity:.5; width:100%; height:100%;vertical-align:middle; text-align:center;">
                </div>
                <div style="position:fixed;  top:0; left:0; width:100%; height:100%; font-size:medium; font-weight:bold; overflow:auto;">
                <table style="width:100%; height:100%;">
                    <tr>
                        <td align="center" valign="middle">

                            <asp:Table ID="tbPanelFoto" runat="server" cellpadding="0" cellspacing="0">
                                <asp:TableRow>
                                <asp:TableCell HorizontalAlign="Right">
                                    <asp:ImageButton ID="ibtPanelFotoClose" runat="server"  ImageUrl="~/App_Themes/Padrao/imagens/backoffice/fechar.png"
                                           OnClick="ibtPanelFotoClose_Click"/>
                                </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow id="tbrowPanelFoto" runat="server">
                                    <asp:TableCell id="tbcellPanelFoto" runat="server" BackColor="#707070" style="vertical-align:middle; text-align:center; padding:5px 10px 5px 10px;" ><center>
                                        <asp:Image ID="imgPanelFoto" runat="server" style="max-width:800px; max-height:600px;" /><br />
                                        <asp:Label ID="lblPanelFoto" runat="server" Text="" style="color:White;"></asp:Label>
                                    </asp:TableCell>
                                </asp:TableRow>
                            </asp:Table>
                            <asp:RoundedCornersExtender ID="rcePanelFoto" runat="server" TargetControlID="tbcellPanelFoto" Radius="8">
                            </asp:RoundedCornersExtender>

                        </td>
                    </tr>
                </table>
                </div>
            </asp:Panel>

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
